#include <iostream>

class Base {
    int gender;
public:
    ~Base() {
        std::cout << "~B()" << std::endl;
    }
};

class Derived: public Base {
    int year;
    int month;
public:
    ~Derived() {
        std::cout << "~D()" << std::endl;
    }
};

int main() {
    Base *b = new Base();
    delete b;
    std::cout << std::endl;
    Derived *d = new Derived();
    delete d;
    std::cout << std::endl;
    Base *bd = new Derived();
    delete bd;
    /**
    std::cout << "Base: " << sizeof(Base) << ", Derived: " << sizeof(Derived) << std::endl;
    Base *b = new Base[10];
    delete [] b;
    std::cout << "delete [] b finish" << std::endl;
    Derived *d = new Derived[10];
    delete [] d;
    std::cout << "delete [] d finish" << std::endl;
    Base *bd = new Derived[10];
    delete [] bd;
    std::cout << "delete [] bd finish" << std::endl;
    */
    return 0;
}

